﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：IRedisCacheDatabaseProvider.cs
// 功能描述：TongTongMall.Redis
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using StackExchange.Redis;
using System.Collections.Generic;
using TongTongMall.Dependecy;

namespace TongTongMall.Redis.Cache
{

    public interface IRedisCacheDatabaseProvider : ISingletonDependency
    {
        /// <summary>
        /// 连接池
        /// </summary>
        ConnectionMultiplexer ConnectionMultiplexer { get; }

        /// <summary>
        /// redis 连接对象
        /// </summary>
        /// <returns></returns>
        IDatabase GetDatabase();

        /// <summary>
        /// 获取server的连接个数
        /// </summary>
        /// <returns></returns>
        IList<IServer> GetServer();

        /// <summary>
        /// 是否从缓存内获取数据
        /// </summary>
        /// <returns></returns>
        bool IsReadForCache { get; }
    }
}
